<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
    // {{{ Basic parameters
    'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
    'name'=>'Yii Bug Tracker',
    'theme'=>'liquid',
    'sourceLanguage' => 'en_us',
    // preloading 'log' component
    'preload'=>array('log','lc'),
    // }}} 
    // {{{ autoloading model and component classes
    'import'=>array(
        'application.models.*',
        'application.components.*',
        'application.components.behaviors.*',
        'application.components.EButtonColumnWithClearFilters',
        'application.components.ERememberFiltersBehavior',
        'application.vendors.*',  
        //'application.vendors.pear.*',
        'application.extensions.button.DDButton',
        'application.extensions.ddeditor.*',
        'application.extensions.ddcrosstab.*',
        'application.extensions.simpleWorkflow.*',
        'application.extensions.OpenFlashChart2Widget.OpenFlashChart2Loader',
    ), // }}} 
    // {{{ application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params'=>require(dirname(__FILE__).'/params.php'),
    // }}} 
    // {{{ Modules
    'modules'=>array( 
        'admin',
        'gii'=>array(
            'class'=>'system.gii.GiiModule',
            'password'=>'gii_pw_01',
            //'ipFilters'=>array('127.0.0.1','192.168.178.*','192.168.56.*','4office','deruewdlxa00584'),
            'generatorPaths'=>array(
                'application.gii',   // a path alias
            ),
        ),
    ), // }}} 
    // {{{ Application components
    'components'=>array(
        'authManager'=>array(
            'class'             => 'CDbAuthManager',
            'connectionID'      => 'db',
            /*
            'itemTable'         => 'tbl_authitem',
            'itemChildTable'    => 'tbl_authitemchild',
            'assignmentTable'   => 'tbl_authassignment',
             */
        ),
        'db'=>file_exists(dirname(__FILE__).'/db_'.str_replace('.','_',$_SERVER['HTTP_HOST']).'.php') ? require(dirname(__FILE__).'/db_'.str_replace('.','_',$_SERVER['HTTP_HOST']).'.php') : array(
                //'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
                'connectionString' => 'mysql:host=localhost;dbname=yii_bugtracker',
                'tablePrefix' => '',
                'username'=>'yii_bugtracker',
                'password'=>'yii_bugtracker_pw_01',
                'charset'=>'utf8',
                'schemaCachingDuration' => 3600,
        ),
	'lc'=>array(
	    'class' => 'application.components.LocaleManager',
        ),
        'session'=>array(
            'sessionName'=>'YII-BUGTRACKER'
        ),
        // uncomment the following to enable URLs in path-format
        'urlManager'=>array(
            /*
            'urlFormat'=>'path',
            'rules'=>array(
                '<controller:\w+>/<id:\d+>'=>'<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
                '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
                'gii'=>'gii',
                'gii/<controller:\w+>'=>'gii/<controller>',
                'gii/<controller:\w+>/<action:\w+>'=>'gii/<controller>/<action>',
            ),
             */
        ),
        'user'=>array(
            'class' => 'WebUser',
            // enable cookie-based authentication
            'allowAutoLogin'=>true,
        ),
        // uncomment the following to use a MySQL database
        /*
        'db'=>array(
            'connectionString' => 'mysql:host=localhost;dbname=testdrive',
            'emulatePrepare' => true,
            'username' => 'root',
            'password' => '',
            'charset' => 'utf8',
        ),
        */
        'errorHandler'=>array(
            // use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
        'myHelper'=>array(
            'class'=>'application.components.MyHelper',
        ),
        'log'=>array(
            'class'=>'CLogRouter',
            'routes'=>array(
                array(
                    'class'=>'CFileLogRoute',
                    'levels'=>'info, error, warning',
                ),
                // uncomment the following to show log messages on web pages
                /*
                array(
                    'class'=>'CWebLogRoute',
                ),
                */
            ),
        ),
        'syntaxhighlighter' => array(
            'class' => 'ext.JMSyntaxHighlighter.JMSyntaxHighlighter',
        ),
        // adding the simple Workflow source component
        'swSource'=> array(
            'class'=>'application.extensions.simpleWorkflow.SWPhpWorkflowSource',
        ),
        // enables theme based JQueryUI's
        'widgetFactory' => array(
            'enableSkin' => true,
            'widgets' => array(
                'application.extensions.calendar.SCalendar' => array(
                    'skin' => 'tiger',
                    'firstDay' => 1,
                ),
            ),
        ),
        'widgetCollapse'=>array(
            'class'=>'WidgetCollapse',
            'enable'=>true,
        ),
    ), // }}} 
    'localeDataPath'=>'protected/i18n/data/',
);
